package com.demon.androidbasic.ui

import android.content.Context
import android.content.Intent
import androidx.fragment.app.Fragment
import com.demon.androidbasic.BaseApplication

/**
 * <p>
 * [类说明]
 * </p>
 *
 * @author zhaozeyang
 * @since 2020/5/25
 */

fun Context.logout() {
//    SessionManager.getUserSession().clearLoginSession()
  val intent = Intent(this, BaseApplication.loginClass)
  intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
  intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
  startActivity(intent)
}

fun Fragment.logout() {
  activity?.logout()
}